$(function () {
    var userid = getCookie('zhihuid');
    $("#question").click(function () {
        $('#question').attr("href", "queryQuestionByUserId?userid=" + userid);
    });

    var userid = getCookie('zhihuid');
    $("#follow-btn").click(function () {
        $('#follow-btn').attr("href", "/myselfFollow");
    });

    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

        if (arr = document.cookie.match(reg))

            return unescape(arr[2]);
        else
            return null;
    }

    // $("#collection").click(function () {
    //     $('#collection').attr("href", "findCollections?userid=" + userid);
    // });
});